﻿<%@ Page Language="C#" MasterPageFile="MasterPage.Master" AutoEventWireup="true"
    CodeBehind="ResourceMenu.aspx.cs" Inherits="Billing2.ResourceMenu" %>
    <%@ Register Src="~/Controls/Admin/ucResourceMenu.ascx" TagName="ucResourceMenu" TagPrefix="uc1" %>
    <%@ Register src="~/Controls/ucPageTitle.ascx" tagname="ucPageTitle" tagprefix="uc2" %>
    <%@ Register src="~/Controls/ucInProgress.ascx" tagname="ucInProgress" tagprefix="uc3" %>
    <%@ Register src="~/Controls/ucSearch.ascx" tagname="ucSearch" tagprefix="uc4" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
        $(function () {
            // Dialog 
            $('#dialogSave').dialog({
                autoOpen: false,
                width: 600,
                modal: true
            });
            $('#dialog').parent().appendTo($("form"));
            $('#dialogUpdate').dialog({
                autoOpen: false,
                width: 600,
                modal: true
            });
            $('#dialog').parent().appendTo($("form"));
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <uc2:ucPageTitle ID="ucPageTitle1" runat="server" />
     <asp:UpdatePanel ID="UpdatePanel5" runat="server">
    <ContentTemplate>
         <uc4:ucSearch ID="ucSearch" runat="server" />
    </ContentTemplate>
    </asp:UpdatePanel>
    <br />
    <asp:UpdatePanel ID="UpdatePanel2" runat="server">
        <ContentTemplate><div class="gridDetail">
            <asp:GridView ID="gvCustomView" runat="server" CellPadding="4"
                CssClass="GridViewStyle" GridLines="Horizontal" AutoGenerateColumns="False" 
                OnRowCommand="gvwOrganization_RowCommand" 
                onpageindexchanging="gvCustomView_PageIndexChanging" 
                onsorting="gvCustomView_Sorting" AllowPaging="True" AllowSorting="True" 
                EnableSortingAndPagingCallbacks="True" PageSize="50" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" ForeColor="Black">
                <PagerStyle BackColor="White" ForeColor="Black" HorizontalAlign="Right" />
                <RowStyle CssClass="GridViewRowStyle" />
                <Columns>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="No">
                        <ItemTemplate>
                            <asp:Label ID="xCol01" runat="server" Text='<%#Container.DataItemIndex+1  %>'></asp:Label>
                        </ItemTemplate>                       
                        <HeaderStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" 
                        HeaderText="Parent Resource Name " SortExpression="ParentName">
                        <ItemTemplate>
                            <asp:Label ID="xCol05" runat="server" Text='<%#Microsoft.Security.Application.Encoder.HtmlEncode(Convert.ToString(Eval("ParentName")))%>'></asp:Label>
                        </ItemTemplate>                        
                        <HeaderStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" 
                        HeaderText="Resource Name" SortExpression="ResourceName">
                        <ItemTemplate>
                                                        <asp:LinkButton runat="server" ID="linkBtnEdit" CommandArgument='<%#Microsoft.Security.Application.Encoder.HtmlEncode(Convert.ToString(Eval("ID")))%>'
                                CommandName="EditData"  Text='<%#Microsoft.Security.Application.Encoder.HtmlEncode(Convert.ToString(Eval("ResourceName")))%>'></asp:LinkButton>

                        </ItemTemplate>                                                
                        <HeaderStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="Page Url" 
                        SortExpression="PageUrl">
                        <ItemTemplate>
                            <asp:Label ID="xCol04" runat="server" Text='<%#Microsoft.Security.Application.Encoder.HtmlEncode(Convert.ToString(Eval("PageUrl")))%>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="Order" 
                        SortExpression="PageOrder">
                        <ItemTemplate>
                            <asp:Label ID="xCol06" runat="server" Text='<%#Microsoft.Security.Application.Encoder.HtmlEncode(Convert.ToString(Eval("PageOrder")))%>'></asp:Label>
                        </ItemTemplate>                        
                        <HeaderStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="Active" 
                        SortExpression="Status">
                        <ItemTemplate>
                            <asp:Label ID="xCol07" runat="server" Text='<%#Microsoft.Security.Application.Encoder.HtmlEncode(Convert.ToString(Eval("Status")))%>'></asp:Label>
                        </ItemTemplate>                        
                        <HeaderStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                </Columns>
                <FooterStyle BackColor="#CCCC99" ForeColor="Black" />
                <HeaderStyle CssClass="GridViewHeaderStyle" BackColor="#333333" Font-Bold="True" ForeColor="White" />
                <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
                <SelectedRowStyle BackColor="#CC3333" Font-Bold="True" ForeColor="White" />
            </asp:GridView></div>
        </ContentTemplate>
    </asp:UpdatePanel>
    <br />

    <asp:UpdatePanel ID="UpdatePanel3" runat="server">
        <ContentTemplate>
            <asp:Button ID="btnAdd" runat="server" Text="Add" CausesValidation="false" CssClass="ui-state-default ui-corner-all"
                OnClick="btnAdd_Click" />
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel3">
    <ProgressTemplate>
        <uc3:ucInProgress ID="ucInProgress" runat="server" />        
    </ProgressTemplate>
    </asp:UpdateProgress>
    <div id="dialogSave" title="Add Resource Menu" style="display: none">
    <div id="dialogSaveEffect">
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <uc1:ucResourceMenu ID="ucResourceMenu1" runat="server" />
            </ContentTemplate>
        </asp:UpdatePanel>
        </div>
    </div>

        <div id="dialogUpdate" title="Update Resource Menu" style="display: none">
            <div id="dialogUpdateEffect">
            <asp:UpdatePanel ID="UpdatePanel4" runat="server">
                <ContentTemplate>
                    <uc1:ucResourceMenu ID="ucResourceMenu2" runat="server" />
                </ContentTemplate>
            </asp:UpdatePanel>
        </div>
    </div>
    <br />
    <br />
</asp:Content>
